import requests
import os

url = "https://image.diyiyou.com/game/202001/10/1578624668_9.jpg"

# 发送请求，获取图片数据
response = requests.get(url)

# 指定保存路径为桌面上的“photo.jpg”文件
save_path = os.path.join(os.path.expanduser("~"), "Desktop", "photo.jpg")

# 保存图片数据到本地
with open(save_path, "wb") as f:
    f.write(response.content)

print("图片已保存到桌面上")
